//
//  Sky72CourseMainViewController.m
//  Sky72
//
//  Created by ladaka on 13. 9. 30..
//  Copyright (c) 2013년 ladaka Inc. All rights reserved.
//

#import "Sky72CourseMainViewController.h"
#import "Sky72CourseViewController.h"
#import "NaviBarUtil.h"

@interface Sky72CourseMainViewController ()

@end

@implementation Sky72CourseMainViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    self.navigationItem.hidesBackButton = YES;
    NaviBarUtil *navBar = [[NaviBarUtil alloc] initWithNavigationController:self.navigationController navigationItem:self.navigationItem];
    [navBar naviBarSetting:@"SKY72 GOLF & RESORT"];
    [navBar addLeftButtonNormalImage:[UIImage imageNamed:@"head_btn_close"]
                      highlightImage:[UIImage imageNamed:@"head_btn_close_ov"] target:self action:@selector(onClickBack)];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)onClickCourse:(id)sender {
    NSLog(@"%s [tag :  %d]", __FUNCTION__, [sender tag]);
    
    switch ([sender tag]) {
        case 1:     // 하늘코스
            break;
        case 2:     // 레이크코스
            break;
        case 3:     // 클래식코스
            break;
        case 4:     // 오션코스
            break;
        case 5:     // Dream
            break;
        case 6:     // Dream Dunes
            break;
            
        default:
            break;
    }
    
    Sky72CourseViewController *controller = [[Sky72CourseViewController alloc]
                                             initWithNibName:@"Sky72CourseViewController" bundle:nil];
    controller._courseTag = [sender tag];   // course tag 전달
    [self.navigationController pushViewController:controller animated:YES];
}

- (void) onClickBack {
    [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:0] animated:YES];
}
@end
